<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>Tk_InternAtom manual page - Library Procedures</TITLE>
<link rel="stylesheet" href="../docs.css" type="text/css" media="all">
</HEAD>
<BODY><H2><a href="../contents.htm">Tcl8.6.11/Tk8.6.11 Documentation</a> <small>&gt;</small> <a href="contents.htm">Tk C API</a> <small>&gt;</small> InternAtom</H2>
<H3><A HREF="../UserCmd/contents.htm">Tcl/Tk Applications</A> | <A HREF="../TclCmd/contents.htm">Tcl Commands</A> | <A HREF="../TkCmd/contents.htm">Tk Commands</A> | <A HREF="../ItclCmd/contents.htm">[incr Tcl] Package Commands</A> | <A HREF="../SqliteCmd/contents.htm">SQLite3 Package Commands</A> | <A HREF="../TdbcCmd/contents.htm">TDBC Package Commands</A> | <A HREF="../TdbcmysqlCmd/contents.htm">tdbc::mysql Package Commands</A> | <A HREF="../TdbcodbcCmd/contents.htm">tdbc::odbc Package Commands</A> | <A HREF="../TdbcpostgresCmd/contents.htm">tdbc::postgres Package Commands</A> | <A HREF="../TdbcsqliteCmd/contents.htm">tdbc::sqlite3 Package Commands</A> | <A HREF="../ThreadCmd/contents.htm">Thread Package Commands</A> | <A HREF="../TclLib/contents.htm">Tcl C API</A> | <A HREF="../TkLib/contents.htm">Tk C API</A> | <A HREF="../ItclLib/contents.htm">[incr Tcl] Package C API</A> | <A HREF="../TdbcLib/contents.htm">TDBC Package C API</A></H3>
<DL>
<DD><A HREF="InternAtom.htm#M2" NAME="L434">NAME</A>
<DL><DD>Tk_InternAtom, Tk_GetAtomName &mdash; manage cache of X atoms</DD></DL>
<DD><A HREF="InternAtom.htm#M3" NAME="L435">SYNOPSIS</A>
<DL>
<DD><B>#include &lt;tk.h&gt;</B>
<DD>Atom
<DD><B>Tk_InternAtom(</B><I>tkwin, name</I>)
<DD>const char *
<DD><B>Tk_GetAtomName(</B><I>tkwin, atom</I>)
</DL>
<DD><A HREF="InternAtom.htm#M4" NAME="L436">ARGUMENTS</A>
<DL class="arguments">
</DL>
<DD><A HREF="InternAtom.htm#M5" NAME="L437">DESCRIPTION</A>
<DD><A HREF="InternAtom.htm#M6" NAME="L438">KEYWORDS</A>
</DL>
<H3><A NAME="M2">NAME</A></H3>
Tk_InternAtom, Tk_GetAtomName &mdash; manage cache of X atoms
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>#include &lt;tk.h&gt;</B><BR>
Atom<BR>
<B>Tk_InternAtom(</B><I>tkwin, name</I>)<BR>
const char *<BR>
<B>Tk_GetAtomName(</B><I>tkwin, atom</I>)<BR>
<H3><A NAME="M4">ARGUMENTS</A></H3>
<DL class="arguments">
<DT><A HREF="../TkLib/WindowId.htm">Tk_Window</A> <B>tkwin</B> (in)<DD>
Token for window.  Used to map atom or name relative to a particular display.
<P><DT>const char <B>*name</B> (in)<DD>
String name for which atom is desired.
<P><DT>Atom <B>atom</B> (in)<DD>
Atom for which corresponding string name is desired.
<P></DL>
<H3><A NAME="M5">DESCRIPTION</A></H3>
These procedures are similar to the Xlib procedures
<B>XInternAtom</B> and <B>XGetAtomName</B>.  <B>Tk_InternAtom</B>
returns the atom identifier associated with string given by
<I>name</I>;  the atom identifier is only valid for the display
associated with <I>tkwin</I>.
<B>Tk_GetAtomName</B> returns the string associated
with <I>atom</I> on <I>tkwin</I>'s display.  The string returned
by <B>Tk_GetAtomName</B> is in Tk's storage:  the caller need
not free this space when finished with the string, and the caller
should not modify the contents of the returned string.
If there is no atom <I>atom</I> on <I>tkwin</I>'s display,
then <B>Tk_GetAtomName</B> returns the string
&ldquo;?bad atom?&rdquo;.
<P>
Tk caches
the information returned by <B>Tk_InternAtom</B> and <B>Tk_GetAtomName</B>
so that future calls
for the same information can be serviced from the cache without
contacting the server.  Thus <B>Tk_InternAtom</B> and <B>Tk_GetAtomName</B>
are generally much faster than their Xlib counterparts, and they
should be used in place of the Xlib procedures.
<H3><A NAME="M6">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#atom">atom</A>, <A href="../Keywords/C.htm#cache">cache</A>, <A href="../Keywords/D.htm#display">display</A>
<div class="copy">Copyright &copy; 1990 The Regents of the University of California.
<BR>Copyright &copy; 1994-1996 Sun Microsystems, Inc.
</div>
</BODY></HTML>
